package com.thermal.thermal_inspection.mapper;

import com.thermal.thermal_inspection.entity.InspectionGroup;
import com.thermal.thermal_inspection.entity.InspectionGroupDetail;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import javax.management.relation.InvalidRelationTypeException;
import java.util.List;

@Repository
@Mapper
public interface InspectionGroupMapper {
    /**
     * 新建数据组
     */
    public Integer addInspectionGroup(String inspectionGroupName);
    /**
     * 新建数据组详情
     */
    public Integer addInspectionGroupDetail(int inspectionGroupId , String attribute,String perUnit);
    /**
     * 根据数据组名获取数据组
     */
    public InspectionGroup getInspectionGroupByGroupName(String inspectionGroupName);
    /**
     * 获取数据组列表
     */
    public List<InspectionGroup> getInspectionGroups();
    /**
     * 获取数据组详情列表
     */
    public List<InspectionGroupDetail> getInspectionGroupDetails(int inspectionGroupId);
    /**
     * 根据数据组ID查询数据组
     */
    public InspectionGroup getInspectionGroupByInspectionId(int inspectionGroupId);
    /**
     * 修改数据组名
     */
    public Integer updateInspectionGroupName(InspectionGroup inspectionGroup);
    /**
     * 通过数据组ID删除数据组
     */
    public Integer deleteInspectionGroup(int inspectionGroupId);
    /**
     * 通过数据组ID删除数据组详情
     */
    public Integer deleteInspectionGroupDetailByGroupId(int inspectionGroupId);
    /**
     * 通过数据组详情ID删除数据组详情
     */
    public Integer deleteInspectionGroupDetailByDetailId(int groupDetailId);

    /**
     * 按照inspectionGroupId递增的顺序获得attribute属性
     */
    List<String> getAscAttributeByGroupId(int inspectionGroupId);
}
